import request from '../../utils/request';
import statUrl from '../urls/stat';


//根据条件获取岗位所有信息
export const fetchStatData = data => {
  return request({
    url: statUrl.fetchStatUrl,
    method: 'get',
    params: data
  });
};

//添加岗位
export const addStat = data => {
  return request({
    headers: {
      "Content-Type": "application/json"
    },
    url: statUrl.addStatUrl,
    method: 'post',
    data: data
  });
};

//更新岗位数据
export const updateStatData = data => {
  return request({
    headers: {
      "Content-Type": "application/json"
    },
    url: statUrl.updateStatUrl,
    method: 'post',
    data: data
  });
};

//根据id删除岗位数据
export const deleteStatById = data => {
  return request({
    url: statUrl.deleteStatUrl,
    method: 'get',
    params: data
  });
};




//获取所有岗位id和名称
export const getStatIdAndName = () => {
  return request({
    url: statUrl.getIdAndNameUrl,
    method: 'get',
  });
};